#set cmake version
cmake_minimum_required(VERSION 3.16)

#set build standard
set(CMAKE_CXX_STANDARD 11)

#set project name
project(camera_test)

#find essential package
FIND_PACKAGE(OpenCV REQUIRED)

#include libraries directory
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})

INCLUDE_DIRECTORIES(includes/)

link_directories() #camera libs include here,each single .so file

#add file to src_lists,then add sources to executable(RECURSE means cmake will search dir recursively)
file(GLOB_RECURSE src_lists
        Camera.cpp
        Camera.h
        DataType.h
        )

#add executable file
add_executable(camera_test test.cpp ${src_lists})

#dynamic link libraries
target_link_libraries(camera_test ${OpenCV_LIBS} -lpthread)

target_link_libraries(camera_test /opt/MVS/lib/64/libFormatConversion.so
                                  /opt/MVS/lib/64/libMediaProcess.so
                                  /opt/MVS/lib/64/libMvCameraControl.so
                                  /opt/MVS/lib/64/libMVRender.so
                                  /opt/MVS/lib/64/libMvUsb3vTL.so)
